import Storage from "@/util/localStorage";
let l_storage = new Storage();

export default {
    // 登入
    LOGIN_IN(state, data) {
        state.UserToken = data.Authorization; // token存入
        state.UserRole = data.role || null; // 用户角色存入 
        l_storage.set("account", data.account, 3600000)//用户账号存入浏览器缓存
    },
    // 登出
    LOGIN_OUT(state) {
        state.UserToken = "";
        state.UserRole = "";
        l_storage.remove("token");
        l_storage.remove("role");
        sessionStorage.clear();
    },
}